
package com.scs.application.modules.base.mapper;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.scs.application.modules.base.dto.MaterialForCertTreeDTO;
import com.scs.application.modules.base.entity.Material;
import com.scs.application.modules.base.request.MaterialQueryRequest;
import com.scs.application.modules.base.vo.ExcelMaterialVO;
import com.scs.application.modules.base.vo.MaterialVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品 mapper对象
 */
@Mapper
public interface MaterialMapper extends BaseMapper<Material> {

    IPage<MaterialVO> page(IPage page, @Param("request") MaterialQueryRequest request);

    IPage<ExcelMaterialVO> pageExcel(IPage page, @Param("request") MaterialQueryRequest request);

    List<MaterialVO> list(@Param("request") MaterialQueryRequest request);

    List<ExcelMaterialVO> listExcel(@Param("request") MaterialQueryRequest request);
    /**
     * 通用分页查询
     * @param page
     * @return
     */
    IPage<MaterialVO> pageCommon(IPage<MaterialVO> page, @Param(Constants.WRAPPER)  QueryWrapper<MaterialVO> queryWrapper);

    // 资质树使用
    List<MaterialForCertTreeDTO> listForCertTree(@Param(Constants.WRAPPER)  QueryWrapper<Material> queryWrapper);
}
